home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7926 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  31 lines

  1. Path: news.informatik.uni-muenchen.de!usenet
  2. From: watzka <watzka@stat.uni-muenchen.de>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: need for function prototypes
  5. Date: Tue, 27 Feb 1996 17:40:33 +0100
  6. Organization: Institut fⁿr Statistik
  7. Message-ID: <31333401.7D03@stat.uni-muenchen.de>
  8. NNTP-Posting-Host: pc9.stat.uni-muenchen.de
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (WinNT; I)
  13.  
  14. Chris Rossall wrote:
  15. > Hello I am having trouble understanding why I should use function
  16. > prototypes. I mean,if the function is defined before it is used,the
  17. > compiler should have enough information about the parameters to
  18. > produce correct code anyway.
  19.  
  20. Yes, indeed, a function definition provides enough information to
  21. produce correct code. If your function returns an int and has no
  22. variable argument list, correct code can be produced without a
  23. function prototype.
  24.  
  25. Function prototypes are useful for _checking_ code, esp. in situations
  26. where the first call to a function in a translation unit will precede
  27. the definition of that function.
  28.  
  29. Kurt
  30.